package com.mybase.app.UI.animation;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.ImageView;
import com.mybase.app.R;

/**
 * Created by tukela on 2015/3/11.
 */
public class AnimationActivity extends Activity implements View.OnClickListener{
    private Button btn1,btn2,btn3,btn4,btn21,btn22,btn23,btn24;
    private ImageView imgView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_animation);
        btn1 = (Button) findViewById(R.id.btn1);
        btn2 = (Button) findViewById(R.id.btn2);
        btn3 = (Button) findViewById(R.id.btn3);
        btn4 = (Button) findViewById(R.id.btn4);
        btn21= (Button) findViewById(R.id.btn21);
        btn22= (Button) findViewById(R.id.btn22);
        btn23= (Button) findViewById(R.id.btn23);
        btn24= (Button) findViewById(R.id.btn24);
        imgView= (ImageView) findViewById(R.id.img);
        btn1.setOnClickListener(this);
                btn2.setOnClickListener(this);
        btn3.setOnClickListener(this);
                btn4.setOnClickListener(this);
        btn21.setOnClickListener(this);
                btn22.setOnClickListener(this);
        btn23.setOnClickListener(this);
                btn24.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId())
        {
            case R.id.btn1:
                Animation animation= AnimationUtils.loadAnimation(this,R.anim.abc_fade_in);
                imgView.startAnimation(animation);

                break;
            case R.id.btn2:
                break;
            case R.id.btn3:
                break;
            case R.id.btn4:
                break;
            case R.id.btn21:
                break;
            case R.id.btn22:
                break;
            case R.id.btn23:
                break;
            case R.id.btn24:
                break;

        }
    }
}
